package pers.lonestar.framework.utils.support.converters;

import pers.lonestar.framework.utils.support.enums.CellDataTypeEnum;
import pers.lonestar.framework.utils.support.metadata.CellData;

public class BooleanConverter implements Converter<Boolean> {
    @Override
    public Boolean convertToJavaObject(CellData<Boolean> cellData) {
        return cellData.getBooleanValue();
    }

    @Override
    public CellData<Boolean> convertToCellData(Boolean data) {
        CellData<Boolean> cellData = new CellData<>();
        cellData.setBooleanValue(data);
        cellData.setType(CellDataTypeEnum.BOOLEAN);
        cellData.setData(data);
        return cellData;
    }
}
